{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n"
     ]
    }
   ],
   "source": [
    "from selenium import webdriver\n",
    "from selenium.webdriver.support.ui import WebDriverWait\n",
    "from selenium.webdriver.support import expected_conditions as EC\n",
    "# url = \"https://www.alimama.com\"\n",
    "url = \"http://shop.m.taobao.com/shop/coupon.htm?seller_id=519128184&activity_id=484d7b9f1ae9475985825ff46644d51e\"\n",
    "browser = webdriver.Chrome()\n",
    "browser.get(url)\n",
    "\n",
    "wait = WebDriverWait(browser, 10)\n",
    "\n",
    "# print wait.until(EC.title_contains(u'阿里妈妈 赢在实效'))\n",
    "if u'淘宝网' in browser.title:\n",
    "    print 1\n",
    "else:\n",
    "    print 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
